package com.yutel.collection;

import java.text.Collator;
import java.util.Arrays;
import java.util.Collections;

public class TestSort {
	public static void main(String[] args) {
		String[] names = { "王飞", "aei", "赵伟超", "杨豹", "李振", "刘帝", "刘博" };
		reverse(names);
		desc(names);
		asc(names);
	}

	public static void reverse(String[] names) {
		Collections.reverse(Arrays.asList(names));// 反转
		System.out.println(Arrays.toString(names));
	}

	public static void desc(String[] names) {
		Arrays.sort(names, Collator.getInstance(java.util.Locale.CHINA));// 升序;
		System.out.println(Arrays.toString(names));
	}

	public static void asc(String[] names) {
		Arrays.sort(names, Collections.reverseOrder(Collator
				.getInstance(java.util.Locale.CHINA)));// 降序;
		System.out.println(Arrays.toString(names));
	}
}
